package com.seedwill.orm.lite;

/**
 * ORM Persistence interface
 * 
 * @author SEEDWILL
 *
 */
public interface IPersistence {

	/**
	 * Create object
	 * @param obj
	 */
	public void create(Object obj);
	
	/**
	 * create and returns object identity
	 * @param obj
	 * @return
	 */
	public java.io.Serializable createIdentity(Object obj);
	
	/**
	 * modify object
	 * @param obj
	 */
	public void modify(Object obj);
	
	/**
	 * modify object by refer identity
	 * @param obj
	 */
	public void modifyById(Object obj, java.io.Serializable id);
	
	
	/**
	 * delete object
	 * @param obj
	 */
	public void delete(Object obj);
	
	
	/**
	 * delete object by refer id
	 * @param schemaName
	 * @param id
	 * @return
	 */
	public void deleteById(String schemaName, java.io.Serializable id);
	
	/**
	 * delete object by refer id
	 * 
	 * @param clz
	 * @param id
	 * @return
	 */
	public void deleteById(Class clz, java.io.Serializable id);
	
	/**
	 * find object by identity
	 * @param schemaName
	 * @param id
	 * @return
	 */
	public Object findById(String schemaName, java.io.Serializable id);
	
	/**
	 * find object by identity
	 * @param clz
	 * @param id
	 * @return
	 */
	public Object findById(Class clz, java.io.Serializable id);
}
